﻿using FireChat.Share.Web.Model.Enums;
using SQLite;

namespace FireChat.Server.Database.Table.Messages;


/// <summary>
/// 消息
/// </summary>
[Table("Message")]
internal class MessageData : DataTableBase
{
    /// <summary>
    /// 消息发送者Id
    /// </summary>
    [Column("AccountId")]
    [NotNull]
    public int AccountId { get; set; } = -1;

    /// <summary>
    /// 接收者Id
    /// </summary>
    [Column("TargetId")]
    [NotNull]
    public int TargetId { get; set; } = -1;

    /// <summary>
    /// 接收者类型
    /// </summary>
    [Column("TargetType")]
    [NotNull]
    public AccountType TargetType { get; set; } = AccountType.None;

    /// <summary>
    /// 消息内容
    /// </summary>
    [Column("Content")]
    [NotNull]
    public string Content { get; set; } = "";

    /// <summary>
    /// 消息是否已读
    /// </summary>
    [Column("IsRead")]
    [NotNull]
    public bool IsRead { get; set; } = false;
}
